#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int fib(int x)
{
	if (x <= 2)
		return 1;
	return fib(x-2) + fib(x - 1);
}
int fib1(int x)
{
	int a = 1;
	int b = 1;
	int c = 1;
	while (x > 2)
	{
		c = a + b;
		a = b;
		b = c;
		x--;
	}
	return b;
}
int main()
{
	printf("%d\n", fib(5));
	printf("%d\n", fib1(10));
	printf("%d", fib1(2));
	return 0;
}